package com.hspedu.homework.homework13;

/**
 * @author 谷其昊
 * @version 1.0
 * @date 2022/1/24
 * @time 20:08
 */
public class Person {
    private String name;
    private String sex;
    private int age;

    public String play(){
        return name + "爱玩";
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public Person(String name, String sex, int age) {
        this.name = name;
        this.sex = sex;
        this.age = age;
    }

    @Override
    public String toString() {
        return
                "name='" + name + '\'' +
                ", sex='" + sex + '\'' +
                ", age=" + age +","
                ;
    }

    public String printInfo(){
        return "\n姓名："+getName()
                +"\n年龄："+getAge()
                +"\n性别："+getSex();
    }
}
